#ifndef SUBTITLE_RENDERER_H
#define SUBTITLE_RENDERER_H

#include <GLee.h>
#include "srtsubtitle.h"

#include <string>

#include <FTGL/ftgl.h>

class SubtitleRenderer
{
public:
    SubtitleRenderer();
    ~SubtitleRenderer();

    void setWindowSize(int width, int height);
    bool loadSubtitle(const std::string& filename);
    void render(uint64 timestamp);

private:
    void renderCurrentSubtitle();
    void renderLine(float xOffset, float yOffset, const std::string& line);

    int                             m_VerticalOffset;
    int                             m_Width;
    int                             m_Height;
    SrtSubtitle                     m_Subtitle;
    FTGLPolygonFont*                m_pFont;
    SubtitleEntity                  m_CurrentSubtitleEntity;
};

#endif
